﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.ServiceModel;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.Logging;
using Microsoft.Practices.Prism.Mvvm;
using Microsoft.Practices.Unity;
using log4net;
using Interfaces;

namespace Services
{
    [ServiceBehavior]
    public class ChartResultsService : IChartResultsService
    {
        private readonly IUnityContainer _container;
        //private readonly ILoggerFacade _logger;

        public ChartResultsService()
        {
            _container = new UnityContainer();
            _container.RegisterType(typeof(IChartResult), typeof(ChartResult));
            _container.RegisterType(typeof(IChartResults), typeof(ChartResults));
        }

        public IChartResults GetResults(string ticker, string period, string days)
        {
            var res = (IChartResults)_container.Resolve(typeof(IChartResults));
            res.Get(ticker, period, days);
            return res;
        }
    }
}
